import request from '@/utils/request'
// import qs from 'qs'

export const getResourcePages = (data: any) =>
  request({
    method: 'POST',
    url: '/boss/course/getQueryCourses',
    data
  })

export const changeState = (params: any) =>
  request({
    method: 'GET',
    url: '/boss/course/changeState',
    params
  })

export const upload = (data: any, onUploadProgress: any) =>
  request({
    method: 'POST',
    url: '/boss/course/upload',
    onUploadProgress,
    data
  })

export const saveOrUpdateCourse = (data: any) =>
  request({
    method: 'POST',
    url: '/boss/course/saveOrUpdateCourse',
    data
  })

export const getCourseById = (params: any) =>
  request({
    method: 'GET',
    url: '/boss/course/getCourseById',
    params
  })

export const getSectionAndLesson = (params: any) =>
  request({
    method: 'GET',
    url: '/boss/course/section/getSectionAndLesson',
    params
  })

export const saveOrUpdateLesson = (data: any) =>
  request({
    method: 'POST',
    url: '/boss/course/lesson/saveOrUpdate',
    data
  })

export const saveOrUpdateSection = (data: any) =>
  request({
    method: 'POST',
    url: '/boss/course/section/saveOrUpdateSection',
    data
  })
